Integrand size = 24, antiderivative size = 63 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {a^2 x}{4}-\frac {i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac {i a^3}{4 d (a-i a \tan (c+d x))} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212} \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac {i a^3}{4 d (a-i a \tan (c+d x))}+\frac {a^2 x}{4} \]
[In]
[Out]
Rule 46
Rule 212
Rule 3568
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (i a^5\right ) \text {Subst}\left (\int \frac {1}{(a-x)^3 (a+x)} \, dx,x,i a \tan (c+d x)\right )}{d} \\ & = -\frac {\left (i a^5\right ) \text {Subst}\left (\int \left (\frac {1}{2 a (a-x)^3}+\frac {1}{4 a^2 (a-x)^2}+\frac {1}{4 a^2 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d} \\ & = -\frac {i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac {i a^3}{4 d (a-i a \tan (c+d x))}-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{4 d} \\ & = \frac {a^2 x}{4}-\frac {i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac {i a^3}{4 d (a-i a \tan (c+d x))} \\ \end{align*}
Time = 0.21 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.83 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {a^2 \left (2 i+\tan (c+d x)+\arctan (\tan (c+d x)) (i+\tan (c+d x))^2\right )}{4 d (i+\tan (c+d x))^2} \]
[In]
[Out]
Time = 6.55 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.70
method | result | size |
risch | \(\frac {a^{2} x}{4}-\frac {i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}}{16 d}-\frac {i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{4 d}\) | \(44\) |
derivativedivides | \(\frac {-a^{2} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {i a^{2} \left (\cos ^{4}\left (d x +c \right )\right )}{2}+a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(100\) |
default | \(\frac {-a^{2} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {i a^{2} \left (\cos ^{4}\left (d x +c \right )\right )}{2}+a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(100\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.65 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {4 \, a^{2} d x - i \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} - 4 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )}}{16 \, d} \]
[In]
[Out]
Time = 0.15 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.38 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {a^{2} x}{4} + \begin {cases} \frac {- 4 i a^{2} d e^{4 i c} e^{4 i d x} - 16 i a^{2} d e^{2 i c} e^{2 i d x}}{64 d^{2}} & \text {for}\: d^{2} \neq 0 \\x \left (\frac {a^{2} e^{4 i c}}{4} + \frac {a^{2} e^{2 i c}}{2}\right ) & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.37 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.06 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {{\left (d x + c\right )} a^{2} + \frac {a^{2} \tan \left (d x + c\right )^{3} + 3 \, a^{2} \tan \left (d x + c\right ) - 2 i \, a^{2}}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{4 \, d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 257 vs. \(2 (49) = 98\).
Time = 0.56 (sec) , antiderivative size = 257, normalized size of antiderivative = 4.08 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {8 \, a^{2} d x e^{\left (4 i \, d x + 2 i \, c\right )} + 16 \, a^{2} d x e^{\left (2 i \, d x\right )} + 8 \, a^{2} d x e^{\left (-2 i \, c\right )} - i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i \, a^{2} e^{\left (2 i \, d x\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, a^{2} e^{\left (-2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) + 2 i \, a^{2} e^{\left (2 i \, d x\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) + i \, a^{2} e^{\left (-2 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - 2 i \, a^{2} e^{\left (8 i \, d x + 6 i \, c\right )} - 12 i \, a^{2} e^{\left (6 i \, d x + 4 i \, c\right )} - 18 i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} - 8 i \, a^{2} e^{\left (2 i \, d x\right )}}{32 \, {\left (d e^{\left (4 i \, d x + 2 i \, c\right )} + 2 \, d e^{\left (2 i \, d x\right )} + d e^{\left (-2 i \, c\right )}\right )}} \]
[In]
[Out]
Time = 3.82 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.79 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {a^2\,x}{4}+\frac {\frac {a^2\,\mathrm {tan}\left (c+d\,x\right )}{4}+\frac {a^2\,1{}\mathrm {i}}{2}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}-1\right )} \]
[In]
[Out]